#!/bin/sh
module_name=('admin' 'algorithm' 'api' 'common' 'community' 'default' 'help' 'log' 'manualorder' 'micro' 'realtrade' 'user' 'activity' 'html' 'mystory' 'research' 'third' 'wizardstock' 'factor' 'competition' 'mall')

if test -z $1 ; then
  cd ../modules

  echo 'start'

  # 遍历拉取所有module的git
  for i in ${module_name[@]}; do

    # echo 'git clone ssh://git@47.93.90.173:23456/www-fe/modules/'$i
    # git clone ssh://git@47.93.90.173:23456/www-fe/modules/$i
    echo 'start push' $i
    cd ./$i
    git checkout .
    git clean -df
    git pull
    cd ../
    echo 'end push' $i
  done
else
  echo 'start pull' $1
  # echo ../modules/$1
  cd ../modules/$1
  git pull
  cd ../../tools
  echo 'end pull' $1
fi
